<form nz-form [formGroup]="group" (ngSubmit)="submit()">
  <nz-form-item>
    <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="name" nzRequired>名称</nz-form-label>
    <nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="nameErrorTpl">
      <input nz-input formControlName="name" />
      <ng-template #nameErrorTpl let-control>
        <ng-container *ngIf="control.hasError('required')">请输入名称!</ng-container>
      </ng-template>
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="username">用户名</nz-form-label>
    <nz-form-control [nzSm]="14" [nzXs]="24">
      <input nz-input formControlName="username" />
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="password">密码</nz-form-label>
    <nz-form-control [nzSm]="14" [nzXs]="24">
      <input nz-input formControlName="password" type="password" />
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="desc">描述</nz-form-label>
    <nz-form-control [nzSm]="14" [nzXs]="24">
      <input nz-input formControlName="desc" />
    </nz-form-control>
  </nz-form-item>

  <!-- <nz-form-item *ngIf="id">
      <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="disabled"
        >启用</nz-form-label
      >

      <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
        <nz-switch name="disabled" formControlName="disabled"></nz-switch>
      </nz-form-control>
    </nz-form-item> -->
</form>